package com.chenliang.ribbon;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: springcloud_all
 * @description: 定义ribbon的随机的负载均衡的策略
 * @author: 陈亮
 * @create: 2022-04-04 14:05
 */

@Configuration
public class RibbonRandomConfig {


    /**
     * 方法名要叫irule
     * 配置的包需要在启动类扫步到的地方
     *
     * @return
     */
    @Bean
    public IRule iRule() {
        return new RandomRule();
    }
}
